const items = document.querySelectorAll(".gallery-item");
const lightbox = document.querySelector(".lightbox");
const lightboxImage = lightbox.querySelector("#lightbox-image");
const closeBtn = lightbox.querySelector("#close-btn");
const showLightbox = item => {
  lightbox.style.display = "flex";
  console.log(item.src);
  lightboxImage.src = item.src.replace("-thumbnail", "");
}

items.forEach(item => {
  item.addEventListener("click", () => showLightbox(item))
})

closeBtn.addEventListener("click", () => lightbox.style.display = "none")
lightbox.addEventListener("click", () => lightbox.style.display = "none")
